<template>
	<view class="mb_33">
		<view class="" v-if="userType==3">
			<view class="manage_header mt_4">
				<view class="fz_16 fc_333 fb">
					店长数据概况
				</view>
				<view class="all_box fz_12 fc_999" @click="bindList(2)">
					查看全部
					<u-icon name="arrow-right" color="#999999"></u-icon>
				</view>
			</view>
			<view class="behavior_empty" v-if="managerList.length==0">
				暂无数据～
			</view>
			<view class="manage_content bc_fff" v-else>
				<view class="single_content w100 height_41 br_4 fz_11 fc_333">
					<view class="pl_12 single_left box width_60 ">
						店长
					</view>
					<view class="single">
						分享
					</view>
					<view class="single">
						收藏
					</view>
					<view class="single">
						购买
					</view>
					<view class="single">
						加购
					</view>
					<view class="single">
						浏览
					</view>
					<view class="single">
						邀请注册
					</view>
				</view>
				<template v-for="(item,index) in managerList">
					<view class="list single_content w100 height_41 br_4 fz_11 fc_333" :key="index" v-if="index<5">
						<view class="pl_12 single_left box  width_60">
							{{item.username}}
						</view>
						<view class="single">
							{{item.shareNum}}次
						</view>
						<view class="single">
							{{item.collectNum}}次
						</view>
						<view class="single">
							{{item.purchaseNum}}次
						</view>
						<view class="single">
							{{item.addNum}}次
						</view>
						<view class="single">
							{{item.lookNum}}次
						</view>
						<view class="single">
							{{item.inviteNum}}次
						</view>
					</view>
				</template>
				<!-- <view class="list single_content w100 height_41 br_4 fz_11 fc_333">
					<view class="pl_12 single_left box  width_60">
						杨导购
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
				</view> -->
			</view>
		</view>
		<view class="">
			<view class="manage_header mt_4">
				<view class="fz_16 fc_333 fb">
					导购员数据概况
				</view>
				<view class="all_box fz_12 fc_999" @click="bindList(1)">
					查看全部
					<u-icon name="arrow-right" color="#999999"></u-icon>
				</view>
			</view>
			<view class="behavior_empty" v-if="guideList.length==0">
				暂无数据～
			</view>
			<view class="manage_content bc_fff" v-else>
				<view class="single_content w100 height_41 br_4 fz_11 fc_333">
					<view class="pl_12 single_left box width_60 ">
						导购员
					</view>
					<view class="single">
						分享
					</view>
					<view class="single">
						收藏
					</view>
					<view class="single">
						购买
					</view>
					<view class="single">
						加购
					</view>
					<view class="single">
						浏览
					</view>
					<view class="single">
						邀请注册
					</view>
				</view>
				<template v-for="(item,index) in guideList">
					<view class="list single_content w100 height_41 br_4 fz_11 fc_333" :key="index" v-if="index<5">
						<view class="pl_12 single_left box  width_60">
							{{item.username}}
						</view>
						<view class="single">
							{{item.shareNum}}次
						</view>
						<view class="single">
							{{item.collectNum}}次
						</view>
						<view class="single">
							{{item.purchaseNum}}次
						</view>
						<view class="single">
							{{item.addNum}}次
						</view>
						<view class="single">
							{{item.lookNum}}次
						</view>
						<view class="single">
							{{item.inviteNum}}次
						</view>
					</view>
				</template>
				<!-- <view class="list single_content w100 height_41 br_4 fz_11 fc_333">
					<view class="pl_12 single_left box  width_60">
						杨导购
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
				</view> -->
			</view>
		</view>
		<view class="">
			<view class="manage_header mt_4">
				<view class="fz_16 fc_333 fb">
					商品数据概况
				</view>
				<view class="all_box fz_12 fc_999" @click="bindList(3)">
					查看全部
					<u-icon name="arrow-right" color="#999999"></u-icon>
				</view>
			</view>
			<view class="behavior_empty" v-if="goodsList.length==0">
				暂无数据～
			</view>
			<view class="manage_content bc_fff" v-else>

				<view class="single_content w100 height_41 br_4 fz_11 fc_333">
					<view class="pl_12 single_left box width_75 ">
						商品名称
					</view>
					<view class="single">
						分享
					</view>
					<view class="single">
						收藏
					</view>
					<view class="single">
						购买
					</view>
					<view class="single">
						加购
					</view>
					<view class="single">
						浏览
					</view>

				</view>
				<template v-for="(item,index) in goodsList">
					<view class="list single_content w100 height_41 br_4 fz_11 fc_333" :key="index" v-if="index<5" @click="bindDetail(1,item)">
						<view class="pl_12 single_left box  width_75">
							{{item.username}}
						</view>
						<view class="single">
							{{item.shareNum || 0}}次
						</view>
						<view class="single">
							{{item.collectNum || 0}}次
						</view>
						<view class="single">
							{{item.purchaseNum || 0}}次
						</view>
						<view class="single">
							{{item.addNum || 0}}次
						</view>
						<view class="single">
							{{item.lookNum || 0}}次
						</view>

					</view>
				</template>
				<!-- <view class="list single_content w100 height_41 br_4 fz_11 fc_333">
					<view class="pl_12 single_left box  width_75">
						芝华士电动按芝华士电动按
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					<view class="single">
						10次
					</view>
					
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			userType: {
				default: 4,
				type: Number,

			},
			behaviorData: {
				default: {},
				type: Object,
			},
			managerList: {
				default: () => ([]),
				type: Array,
			},
			guideList: {
				default: () => ([]),
				type: Array,
			},
			goodsList: {
				default: () => ([]),
				type: Array,
			},

		},
		data: {
			// managerList:[],
			// salesList:[],
			// goodsList:[]
		},

		created() {
			setTimeout(()=>{
				console.log("子组件拿到的数据")
				console.log(this.managerList)
				console.log(this.guideList)
				console.log(this.goodsList)
			},3000)
		
			// this.managerList = this.behaviorData
		},
			
		computed: {
			// goodsList(){
			// 	return this.behaviorData.goodsList
			// }
		},

		methods: {
			bindDetail(type,item){
				uni.navigateTo({
					url:`/pages/subRadar/index?showType=${type}&managerId=${item.customerId}`
				})
				
			},
			bindList(type) {
				uni.navigateTo({
					url: `/pages/radar/behavior_list?type=${type}`
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	.manage_header {
		@include set_padding(12rpx, 0rpx);
		@include flex_box(row, nowrap, space-between, center);

		.all_box {
			@include flex_box(row, nowrap, flex-end, center);
		}
	}

	.behavior_empty {
		width: 100%;
		height: 180rpx;
		font-size: 28rpx;
		color: #999999;
		text-align: center;
		background: #ffffff;
		line-height: 180rpx;
	}

	.manage_content {

		.single_content {
			@include flex_box(row, nowrap, space-between, center);
			border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);

			.single_left {
				white-space: nowrap;
				text-overflow: ellipsis;
				overflow: hidden;
			}

			.single {
				white-space: nowrap;
				@include set_padding(0rpx, 12rpx);
			}
		}

		.list {
			color: #86909C;
		}
	}
</style>